package com.wang.pojo;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.wang.common.pojo.BasePojo;



/**
 * admins的pojo
 * 
 * @author MyJjh
 *
 */
public class AAdmins extends BasePojo<AAdmins>
{
	private int id;
	private String email;
	private String password;
	private String trueName;
	private String phone;
	private String qq;
	private byte sex;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date lastLoginTime;
	
	/* 字符串描述 */
	private String statusStr ; 
	private String sexStr ; 
	/*  枚举值 */
	private Map<String,Object> enumsMap = new TreeMap<String, Object>();
	
	/**
	 * 获取一个map;
	 * map有两个要素：键和值,而枚举有三个要素:code,info,枚举项
	 * @return	map的键是:枚举项-code值,值是:info
	 */
	public Map<String, Object> getEnumsMap()
	{
		for(AAdminsEnum enumTemp : AAdminsEnum.values())
		{
			enumsMap.put(enumTemp.toString() + "-" + enumTemp.getCode(), enumTemp.getInfo());
		}
		return enumsMap;
	}
	
	/**
	 * 根据status的值,和枚举中对应的值,
	 * 返回枚举对应的字符串
	 * @return
	 */
	public String getStatusStr()
	{
		for(AAdminsEnum enumTemp : AAdminsEnum.values())
		{
			if(enumTemp.toString().startsWith("STATUS_")
				&& enumTemp.getCode() == this.getStatus())
			{
				return enumTemp.getInfo() ; 
			}
		}
		return statusStr;
	}
	
	public String getSexStr()
	{
		for(AAdminsEnum enumTemp : AAdminsEnum.values())
		{
			if(enumTemp.toString().startsWith("SEX_")
				&& enumTemp.getCode() == this.getSex())
			{
				return enumTemp.getInfo() ; 
			}
		}
		return sexStr;
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public String getEmail()
	{
		return email;
	}

	public void setEmail(String email)
	{
		this.email = email;
	}

	public String getPassword()
	{
		return password;
	}

	public void setPassword(String password)
	{
		this.password = password;
	}

	public String getTrueName()
	{
		return trueName;
	}

	public void setTrueName(String trueName)
	{
		this.trueName = trueName;
	}

	public String getPhone()
	{
		return phone;
	}

	public void setPhone(String phone)
	{
		this.phone = phone;
	}

	public String getQq()
	{
		return qq;
	}

	public void setQq(String qq)
	{
		this.qq = qq;
	}

	public byte getSex()
	{
		return sex;
	}

	public void setSex(byte sex)
	{
		this.sex = sex;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getLastLoginTime()
	{
		return lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime)
	{
		this.lastLoginTime = lastLoginTime;
	}

}
